debug = True

env = Environment(
	LIBS=[Split('user32 uxtheme comctl32 shell32 ole32')], 
	CPPDEFINES={'WINVER': '0x0501'}
)
env.VariantDir('build', '.', duplicate=0)

res = env.RES('build/mmres.rc')

dll_sources = ['dll.c', 'support.c', 'mm.def']
exe_sources = ['mm.c', 'monitors.c', 'mmbar.c', 'window.c', 'system.c', 
		'support.c', 'taskbar.c', 'events.c']
		
dll_sources =  ['build/'+x for x in dll_sources]
exe_sources =  ['build/'+x for x in exe_sources]


if env['CC'] != 'cl':
	print "Visual C++ required, sorry"
	import sys
	sys.exit(-1)

if debug:
	env.Append(CPPDEFINES=['DEBUG'])
	env.Append(CCFLAGS=['/Zi'], LINKFLAGS=['/DEBUG'])
	#env.Append(CCFLAGS=['/O2'])

dll = env.SharedLibrary(
	'build/MonMan', dll_sources
)
exe = env.Program(
	'build/MonMan', exe_sources + [res]
)
env.Install('dist', [dll[0], exe, 'MonMan.txt', 'MonMan.exe.manifest'])
